package l1j.opqlo.掛機;

import l1j.server.server.datatables.SkillsTable;
import l1j.server.server.datatables.SprTable;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.templates.L1Skills;

public class RobotTemp {

	
	private L1PcInstance _pc;
	private L1Skills _skill;
	private long _lastTime;
	private int _skillId ;
	
	public RobotTemp(final L1PcInstance pc , final int skillid ){
		_pc = pc;
		_skill = SkillsTable.getInstance().getTemplate(skillid);
		_lastTime = 0;
		_skillId = skillid;
	}
	
	
	public boolean checkDelay(){
		final int delay = SprTable.getInstance().getSprSpeed(_pc.getGfxId(), _skill.getActionId());
		
		if(System.currentTimeMillis() - _lastTime >= delay){
			return true;
		}
		return false;
	}
	
	public void setDelay(){
		_lastTime = System.currentTimeMillis();
	}
	
	public L1PcInstance getPc(){
		return _pc;
	}
	
	public int getSkillId(){
		return _skillId;
	}
	
	
	
	
	
}
